import { request } from "./request"


// 获取充值信息
export const getOrderInfo = () => {
	return request({
		url: 'v1/payOrders/getOrderInfo',
		method: 'POST',
	})
}

// 获取充值价格
interface payCombosProps{
	type?: string | number
	versionCode?: string | number
}
export const payCombos = (data?: payCombosProps) => {
	return request({
		url: 'v1/payCombos/list',
		method: 'GET',
		data
	})
}
// 支付提交订单
interface submitOrderParentProps{
		appType: 1 | 2
		channel?: string,
		orderSource: 'pc' | 'wap' | 'app'
		orderType: number
		payChannel: 1 | 2 | 3 //1微信2支付宝3苹果
		payComboId: string | number
		studentId: string | number
		tradeType: string
}
export const submitOrderParent = ({studentId, payComboId}) => {
	return request({
		url: 'v1/payOrders/submitOrderParent',
		method: 'POST',
		data: {
			"studentId":studentId,
			"orderType":"0",
			"orderSource":"app",
			"payComboId": payComboId,
			"payChannel":"1",
			"tradeType":"APP"
		}
	})
}



// 小程序支付
export const miniappPay =  (data) => {
	return request({
		url: 'v1/miniapp/pay',
		method: 'POST',
		data
	})
}
